
const { contextBridge, ipcRenderer} = require('electron')

contextBridge.exposeInMainWorld('preload',{
    buttonClick: ()=>{
        ipcRenderer.invoke('buttonClick',true)
    }
})

ipcRenderer.on('on-menu',(event,flag) => {
    const btn = document.getElementById('btn')
    if(flag === 'bold') {
        btn.style.fontWeight = 'bold'

    } else if(flag === 'color') {
        btn.style.color = 'red'
    }
})